<link href="__THEME__/public.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/js/jquery.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/ts_common.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/ymPrompt/ymPrompt_Ex.js"></script>
<link rel="stylesheet" id='skin' type="text/css" href="__PUBLIC__/js/ymPrompt/skin/qq/ymPrompt.css" />

<script type="text/javascript">
<!--
	//指定当前组模块URL地址
	var	URL		=	'__URL__';
	var	APP		=	'__APP__';
	var	PUBLIC	=	'__PUBLIC__';
	var	ROOT	=	'__ROOT__';
	var TS		=	'__TS__';
	var MID		=	'{$mid|intval}';
	var NEED_LOGIN	=	'{$TS_NEED_LOGIN}';
	var expire  = <?php echo C('COOKIE_EXPIRE');?>;
    var TPIS = '{$site_opts["tips"]}';

//-->
</script>

<div id="commonbox" class="commonbox">
  <div id="tab1" class="commonbox-bd tab1_content">
  	<form action="#" method="post">
		<h3>现在感觉如何？</h3>
		<label><input type="radio" name="status" value="5" checked="checked" />非常好</label>
		<label><input type="radio" name="status" value="4"/>好</label>
		<label><input type="radio" name="status" value="3"/>一般</label>
		<label><input type="radio" name="status" value="2"/>差</label>
		<label><input type="radio" name="status" value="1"/>非常差</label>
		<div class="separate"></div>
		<h3 style="display: inline;">描述（可选）</h3><span style="float: right;" id="mb-hint"><b><span id="zishu">100</span></b>/100</span>
		<textarea id="xq_con" name="desc" class="area_bg" placeholder="简单描述下你的症状！" onKeyDown="fot(this)" onKeyUp="fot(this)"></textarea>
  		<input type="button" class="sub-btn" value="提 交" onclick="doAddMini();return false;"/>
  		<!-- <a href="#" class="adddoc">添加照片或文档</a> -->
  	</form>
  </div> 
</div> 
  	
<style>
.commonbox {text-align:left;}
.commonbox .commonbox-hd{
	padding-left:50px;
	height:40px;
	line-height:2;
}
.commonbox .commonbox-hd li{
	height:40px;
	width:80px;
	float: left;
	margin-right:50px;
	position: relative;
}

.commonbox .commonbox-hd li a{
	color: #333333;
	display: block;
	width:50px;
	height: 40px;
	padding-left:30px;
	position: absolute;
	bottom:-8px;	
}

.commonbox .commonbox-hd .tab1_bg{
	background: url("../images/tab1_bg.png") no-repeat left 10px;
}

.commonbox .commonbox-hd .tab2_bg{
	background: url("../images/tab2_bg.png") no-repeat left 10px;
}

.commonbox .commonbox-hd .tab3_bg{
	background: url("../images/tab3_bg.png") no-repeat left 10px;
}

.commonbox .commonbox-hd .selected{
	background: url("../images/current_type.png") no-repeat center bottom;
	z-index: 99;
}

.commonbox .commonbox-bd{
	background: url("../images/commonbox_bg.png") no-repeat;
	width:auto;
	height: auto;
	padding:5px;
	line-height: 30px;
}
.commonbox .tab1_content{position: relative;}
.commonbox .tab1_content h3{color:#333333;}
.commonbox .tab1_content label{margin-right:30px;}
.commonbox .tab1_content .area_bg{
	width: 500px;
	height: 60px;
	max-width: 520px;
	max-height: 60px;
	border: 0px;
	line-height: 24px;
	text-indent: 5px;	
	border: solid 1px #d2d2d2;
	border-radius: 5px;
	-moz-box-shadow: inset 1px 1px 4px rgba(0,0,0,.1);
	-webkit-box-shadow: inset 1px 1px 4px rgba(0, 0, 0, .1);
	box-shadow: inset 1px 1px 4px rgba(0, 0, 0, .1);	
	margin:5px 0 ;
}
.commonbox .tab1_content input[type=radio] {
	height: 14px;
	width: 14px;
	margin: 5px;
	vertical-align: middle;
	outline: 0;
}

.commonbox .tab1_content .sub-btn{
	margin-top:3px;
	display: block;
	height: 24px;
	line-height: 24px;
	padding: 0;
	width: 60px;
	background-color:#c00000;
	color: #ffffff;
	text-align: center;
	border: 1px solid #ca8000;
	-webkit-border-radius: 0px;
	-moz-border-radius: 0px;
	border-radius: 3px;
	cursor: pointer;	
}
.commonbox .tab1_content .separate{
	width: 100%;
	height: 0px;
	border-top: solid 1px #f9f9f9;
	border-bottom: solid 1px #efefef;
	margin:5px 0 ;
}
.commonbox .tab1_content .adddoc{
	position: absolute;
	right: 25px;
	bottom:15px;
	background: url('../images/imgicon.png') no-repeat left center;
	padding-left:30px;
}
	
</style>
<script>
var mini_zishu = '{$stringcount}';
var MID = '{$mid}';
//添加心情
function doAddMini(){
  var content = $( '#xq_con' ).val();
  var status = $('#tab1').find("input[type=radio]:checked").val();
  //检测合法性

 //if(!content) {alert("不能为空哦~~~");return;}
 
 if(content.length>mini_zishu) {alert("不能多于mini_zishu个字哦~~~");return;}

  $( '.sub-btn' ).attr( 'disabled',true );
      $(".phiz").hide();
      $( ".jishuan" ).hide();

  //POST提交
  $.post( ROOT+"/apps/mini/index.php?s=Index/doAddMini/",{content:content,status:status},function( txt ){
      if(false == checkJsToken(txt)){
          $( '.sub-btn').removeAttr('disabled');
          return true;
      }
      if( txt ){
      	  ymPrompt.close();
      	  ymPrompt.alert("数据提交成功！");
          $( '#mini-content' ).html( txt );
          $( '#mini-time' ).html( '刚刚' );
          $( '#xq_con' ).val('');
          $( '#mini-count' ).html( mini_zishu+"/"+mini_zishu );
          $( '.sub-btn').removeAttr('disabled');

      }else{
  		ymPrompt.alert( "数据提交失败！" );
        $(this).removeAttr('disabled');
      }
      });


}

 //字数递减和限制字数
 function fot(e){
        //递减字数
        var d = document.getElementById("zishu");
        var c = e.value.length;
        var xxx = mini_zishu - c;
        if(c<=mini_zishu){
            d.innerHTML =xxx;
        }else{
           e.value = lastinput;
          $( '#xq_con' ).focus();
          return false;
        }
        lastinput = e.value;
   }
</script>